local opts = { noremap = true, silent = true }
local opts_echo = { noremap = true, silent = false }
-- silent control whether the command show in command line.
-- noremap = false, silent = false by default

local keymap = vim.api.nvim_set_keymap

-- vim.g.mapleader = " "
vim.g.mapleader = ";"

keymap("", "<Leader>k", ":", opts_echo)
keymap("", "<Leader>h", ":h ", opts_echo)
keymap("", "<Leader>w", ":w<CR>", opts)
keymap("", "<Leader>q", ":q<CR>", opts)
keymap("", "<Leader>wq", ":wq<CR>", opts)
keymap("", "<Leader>fq", ":q!<CR>", opts)

--[[ keymap("", "ss", ":w<CR>", opts)
keymap("", "qq", ":q<CR>", opts)
keymap("", "fq", ":q!<CR>", opts) ]]

-- keymap("", "<Leader>wb", ":split<CR>", opts)
-- keymap("", "<Leader>wv", ":vsplit<CR>", opts)

-- keymap("", "<Leader>wh", "<C-w>h", opts)
-- keymap("", "<Leader>wj", "<C-w>j", opts)
-- keymap("", "<Leader>wk", "<C-w>k", opts)
-- keymap("", "<Leader>wl", "<C-w>l", opts)
-- keymap("", "<Left>", "<C-w>h", opts)
-- keymap("", "<Down>", "<C-w>j", opts)
-- keymap("", "<Up>", "<C-w>k", opts)
-- keymap("", "<Right>", "<C-w>l", opts)

keymap("", "<Leader>ww", "<C-w><C-w>", opts)

keymap("", "<C-h>", ":%s///gc<Left><Left><Left><Left>", opts_echo)

keymap("", "<Leader>e", ":e ", opts_echo)
